package com.myCode.thread;

public class ThreadMain {

    public static void main(String[] args) throws InterruptedException {
        // 中止线程
        // stopThread();

    //    创建线程通信
    //     ThreadMessage threadMessage = new ThreadMessage();
        // threadMessage.shareVariable();
        // threadMessage.suspendResumeTest();
        // threadMessage.waitNotify();
        // threadMessage.parkUnpark();
        // ThreadClose threadClose = new ThreadClose();
        // threadClose.threadLocalTest();

        ThreadPool threadPool = new ThreadPool();

        threadPool.threadPoolExecutorTest();
    }

    private static void stopThread() throws InterruptedException {
        StopThreadDemo stopThreadDemo = new StopThreadDemo();

        stopThreadDemo.start();

        // Thread.sleep(1L);
        // stop 结束线程
        // stopThreadDemo.stop();

        // interrupt 中止线程
        stopThreadDemo.interrupt();

        System.out.println(" 程序 interrupt  ");
        // Thread.sleep(4000L);

        // Thread.sleep(4000L);

        // StopThreadDemo.setFlag(false);

        // Thread.sleep(4000L);

        System.out.println(" 程序运行结束  ");
    }
}
